<template>
  <div>
      <div class="main">
          <div class="schedule-item" v-for="(item,index) in list" :key="index">
              <div class="left">
                  <div class="start-at">{{new Date(parseInt(item.showAt)*1000).toLocaleString('chinese',{hour12:false}).slice(9,15)}}</div>
                  <div class="end-at">{{new Date(parseInt(item.endAt)*1000).toLocaleString('chinese',{hour12:false}).slice(9,15)+"散场"}}</div>
              </div>
              <div class="middle">
                  <div class="language">{{item.filmLanguage}}{{item.imagery}}</div>
                  <div class="hall">{{item.hallName}}</div>
              </div>
              <div class="right" v-if="item.isOnsell" @click="goto(item.scheduleId)">
                  <div class="buy-ticket">购票</div>
              </div>
          </div>
      </div>
  </div>
</template>

<script>
export default {
props:['list','n'],
data() {
    return {
        
    }
},
created(){
    console.log(this.list)
},
methods: {
    goto(id){
        if(localStorage.getItem('user')){
            this.$router.push("/select/"+id)
        }else{
            this.$router.push('/login/'+id)
        }
        // 
    }
},
}
</script>


<style lang="scss" scoped>
*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
.schedule-item {
    height: 74px;
    padding: 15px;
    position: relative;
    background: #fff;
    .left {
    float: left;
    width: 100px;
    .start-at {
    font-size: 15px;
    color: #191a1b;
}
.end-at {
    font-size: 13px;
    color: #797d82;
    margin-top: 2px;
}
}
.middle{
    float: left;
    width: calc(100% - 240px);
    .language{
            font-size: 15px;
            color: #191a1b;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
    }
    .hall{
            font-size: 13px;
            color: #797d82;
            margin-top: 2px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
    }
}
.right{
    float: right;
    padding: 10px 0;
    line-height: 25px;
    color: #ff5f16;
    .buy-ticket {
    float: right;
    height: 25px;
    width: 50px;
    border-radius: 2px;
    position: relative;
    text-align: center;
}
.buy-ticket:after {
    content: " ";
    transform: scale(.5);
    position: absolute;
    border: 1px solid #ff5f16;
    top: -50%;
    right: -50%;
    bottom: -50%;
    left: -50%;
    border-radius: 4px;
}
}
}
</style>